Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

433
Visualizações
Django App Deploy on AWS Elastic Beanstalk Error: relation "django_site" does not exist

I am using this popular tutorial to deploy a django app on AWS EB. https://realpython.com/blog/python/deploying-a-django-app-to-aws-elastic-beanstalk/

After deploying I am getting the following error:

ProgrammingError at /accounts/login/
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...

Fixes others have suggested that I have done:

  • I have 'django.contrib.sites' in my installed apps (settings.py)
  • I have SITE_ID = 1 in settings

Some are suggesting that you run manage.py migrate sites before migrating the rest of the tables.

Does anyone know how to do that on an AWS instance? I SSH'd in and that command won't run.

Any help would be very much appreciated. I've been battling AWS Elastic Beanstalk for a week now.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I've deployed my Django project using Apache recently, and ran into a similar problem as I got the error about the Site not existing.

You have to create a "site", in your database, and chose it's domain and a name for it. Then, in your settings.py file, you should add the SITE_ID number corresponding to the "site" you've just created (which can actually be 1 but might take other values), and it should run properly if everything's done correctly.

I've learned this from an answer here on Stack Overflow, it explains the commands you need to run to acheive this: https://stackoverflow.com/a/11814271/6857994

Good luck

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda